/*
 * @Author: your name
 * @Date: 2021-04-15 20:03:26
 * @LastEditTime: 2021-04-16 16:23:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /flutter_demo/lib/pages/User.dart
 */
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class UserPage extends StatelessWidget {
  List<Map> imgList = [
    {
      'id': 0,
      'url': 'https://t7.baidu.com/it/u=1819248061,230866778&fm=193&f=GIF'
    },
    {
      'id': 1,
      'url': 'https://t7.baidu.com/it/u=825057118,3516313570&fm=193&f=GIF'
    },
    {
      'id': 2,
      'url': 'https://t7.baidu.com/it/u=12235476,3874255656&fm=193&f=GIF'
    }
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('用户中心'),
        ),
        body: Column(children: <Widget>[
          Container(
              width: double.infinity,
              child: AspectRatio(
                  aspectRatio: 16 / 9,
                  child: Swiper(
                    itemBuilder: (BuildContext context, int index) {
                      return Image.network(
                        imgList[index]['url'],
                        fit: BoxFit.cover,
                      );
                    },
                    autoplay: true,
                    itemCount: imgList.length,
                    pagination: new SwiperPagination(),
                    // control: new SwiperControl(),
                  ))),
        ]));
  }
}
